﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Furion.Logging;
using Microsoft.Extensions.Logging;
using SqlSugar;

namespace TimeJob.Core
{
    [SugarTable]
    public class LogTable
    {
        /// <summary>
        /// 记录器类别名称
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string LogName { get; }

        /// <summary>
        /// 日志级别
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public LogLevel LogLevel { get; }

        ///// <summary>
        ///// 事件 Id
        ///// </summary>
        //public EventId EventId { get; }

        /// <summary>
        /// 日志消息
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Message { get; set; }


        /// <summary>
        /// 当前状态值
        /// </summary>
        /// <remarks>可以是任意类型</remarks>
        [SugarColumn(IsNullable = true)]
        public string State { get; }

        /// <summary>
        /// 日志记录时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? LogDateTime { get; }

        /// <summary>
        /// 线程 Id
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int ThreadId { get; }


        /// <summary>
        /// 请求/跟踪 Id
        /// </summary>
        [SugarColumn(IsNullable = true)] 
        public string TraceId { get; }


        /// <summary>
        /// 记录时间
        /// </summary>
        [SugarColumn(InsertServerTime = true, IsOnlyIgnoreUpdate = true)]
        public DateTime CreateTime { get; }
    }
}
